<?php
namespace app\admin\controller;

use think\Controller;
use think\Cache;
use think\Request;
use think\Db;
use think\Cookie;
use think\Session;

class Logout extends Controller
{

    public function index()
    {
        if(Request::instance()->isAjax()){
            Session::clear();
            Cookie::delete('username');
            $data['msg'] = '退出成功';
            $data['code'] = '0';
            $data['data'] = null;
            return $data;
        }
    }

}